package com.yjtc.cbg.commonutildemo.app;

import android.app.Application;
import android.os.Handler;
import android.os.Message;

/**
 * Created by chenboge on 16/8/3.
 */
public class MyApplication extends Application {

    //获取数据成功
    public static final int CITY_LIST_SCUESS = 1000;


    public MyApplication() {
    }

    private volatile static MyApplication mApplication;

    public static synchronized MyApplication getInstance() {
        if (mApplication == null) {
            synchronized (MyApplication.class) {
                if (mApplication == null) {
                    mApplication = new MyApplication();
                }
            }
        }
        return mApplication;
    }


    @Override
    public void onCreate() {
        super.onCreate();
    }

    public void initData(final Handler handler) {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Message message = Message.obtain();
                message.what = CITY_LIST_SCUESS;
                handler.sendMessage(message);
            }
        }
                , 6000);
    }

}
